package com.googlecode.gaal.vis;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import com.googlecode.gaal.preprocess.api.Normalizer;

public class LaTeXNormailzer implements Normalizer<String> {

    public static final Set<String> ESCAPABLE = Collections.unmodifiableSet(new HashSet<String>(Arrays
            .asList(new String[] { "#" })));

    public static final String ESCAPE = "\\";

    @Override
    public String normalize(String token) {
        if (ESCAPABLE.contains(token)) {
            return ESCAPE + token;
        } else {
            return token;
        }
    }

}
